﻿using Prism.Ioc;
using Prism.Modularity;
using Prism.Navigation.Regions;
using Rafy.YuWen.Views;

namespace Rafy.YuWen
{
    public class YuWenModule : IModule
    {
        public void OnInitialized(IContainerProvider containerProvider)
        {
            //var regionManager = containerProvider.Resolve<IRegionManager>();

            //方法1  向ContentRegion控件中注入YuWenDict视图
            //regionManager.RegisterViewWithRegion("ContentRegion", typeof(YuWenDict));

            //方法2 这里用视图注入
            //var region = regionManager.Regions["ContentRegion"];
            //region.RequestNavigate("YuWenDict");
        }
        //注册导航
        public void RegisterTypes(IContainerRegistry containerRegistry)
        {           
            containerRegistry.RegisterForNavigation<YuWenDict>();
        }
    }
}